<?php

class viewcust extends page
{	  
	var $body_tpl = "page_templates/viewcust.tpl";
	
  	
	function page_do()
	{
		parent::page_do();
		global $config;
		   		   
	
		if (@$_REQUEST['submit'] == "View")
		{
			Ice_loadProfile();
			global $ICE;

			$proxy = $ICE->stringToProxy($config['CS430 Integration']['crm orb locator']);

			$crm = $proxy->ice_checkedCast("::CustomerRelationsManagement::CRM");
			
			$cust = $crm->LoadCustomerById(intval(@$_REQUEST['custnum']));
			
			$arr = array(
				$cust->getId(),
				$cust->getName(),
			);
			
			@$this->body->assign_var('data', "<tr><td>" . implode("</td><td>", $arr) . "</td></tr>");
			
		}
				
	}	  
}

?>